<style>
    #ConflictIdEdit input {
        border: none;
    }
    
    .angucomplete-dropdown {
        width: 166px
    }
</style>

<!-- list is beginning -->
<div class="cont">
    <div>
        <div class="position "><img alt="位置图标" src="dist/images/position.png" />风控管理>撞单审查
            <a ng-click="openDetail()" ng-hide="$needClientCache" title="打开新窗口查看"><i class="large External icon"></i></a>
        </div>
        <!--vieving style-->
        <div class="cont_fr_top">
            <div class="cont_fr_btn">
                <div style="height: 20px;">
                    <div class="fr">
                        <button class="cont_f_btn3" ng-click="addConflict()"><i class="add icon"></i>添加</button>
                    </div>
                </div>
            </div>
            <div class="menus">
                <div class="menus_con ui form">
                    <div class="four fields">
                        <div class="inline field">
                            <label>综合查询</label>
                            <input type="text" style="width:160px;" placeholder="客户姓名/号码/编号" name="textfield" ng-model="param.customer_name" ng-keyup="$event.keyCode == 13 && conflictDatalist()">
                        </div>
                        <div class="inline field">
                            <label>提交人员</label>
                            <input type="text" style="width:175px;" placeholder="提交人员" name="textfield" ng-model="param.conflict_person" ng-keyup="$event.keyCode == 13 && conflictDatalist()">
                        </div>
                        <!--<div class="inline field">
                                <label>开始时间</label>
                                <div class="ui left icon input">
                                        <input type="text" id="Start_time"  ng-model="param.recordStartTime" ng-keyup="$event.keyCode == 13 && conflictDatalist()"  datetimepicker format='YYYY-MM-DD' placeholder="开始时间" style="width: 160px">
                                        <i class="calendar icon"></i>
                                </div>
                            </div>
                            <div class="inline field">
                                <label>结束时间</label>
                                <div class="ui left icon input">
                                    <input type="text" id="End_time" ng-model="param.recordEndTime" ng-keyup="$event.keyCode == 13 && conflictDatalist()" datetimepicker format='YYYY-MM-DD' placeholder="结束时间" style="width: 160px">
                                    <i class="calendar icon"></i>
                                </div>
                            </div>-->
                        <!--</div>-->
                        <!--<div class="four fields"  style="line-height: 36px">-->
                        <!--<div class="inline field">
                            <label>归属业务经理</label>
                            <select ng-model="param.company_opinion" class="ui dropdown" ng-options="sub.sector_id as sub.sector_name for sub in subcompay_All">
                                    <option value="" selected disabled hidden>归属业务经理</option>
                                </select>
                        </div>-->
                        <div class="field">
                            <label class="fl" style="line-height: 32px; color: #666">归属业务经理</label>
                            <input type="hidden" name="search_userManager" id="search_userManager" />
                            <div angucomplete-alt id="ConMsgUserManager" class="fl" placeholder="归属业务经理" maxlength="50" name="ConMsgUserManager" pause="100" selected-object="selectUserManager" local-data="UserManagerMsg" search-fields="nickname" title-field="nickname" minlength="1"
                                input-class="form-control form-control-small" match-class="highlight" input-changed="UserManagerinputChanged" focus-first='true' style="width: 160px; margin-left: 1em;border: none"></div>
                        </div>
                        <div class="inline field">
                            <label>处理状态</label>
                            <select ng-model="param.dealstatus" class="ui dropdown" ng-options="subdeal.k as subdeal.v for subdeal in dealstatusdata">
                                    <option value="" selected disabled hidden>处理状态</option>
                                </select>
                        </div>
                    </div>
                    <div class="fields">
                        <div class="four wide field" style="margin-left: 67px;">
                            <button class="search_btn" ng-click="conflictDatalist()">查询</button>
                            <!--<button class="clear_btn"  ng-click="exportRecords()">导出</button>                            -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="menus_table">
        <!--表格-->
        <table class="ui yellow celled striped table">
            <thead>
                <tr>
                    <!--客户姓名，争议的金额，业务员，经理，提出争议业务员，经理，争议提交时间，申请状态，操作-->
                    <!--<th>客户姓名</th>
                <th>最早交款时间</th>
                <th>最早交款金额</th>
                <th>业务员</th>
                <th>团队	</th>
                <th>最后交款时间	</th>
                <th>最后交款金额</th>
                <th>提出争议人员</th>
                <th>团队	</th>
                <th>提交时间	</th>
                <th>申诉状态	</th>
                <th>操作</th>         -->
                    <th>客户姓名</th>
                    <th style="text-align: right;">争议的金额</th>
                    <th>业务员</th>
                    <th>经理</th>
                    <th>提出争议业务员</th>
                    <th>经理</th>
                    <th>争议提交时间</th>
                    <th>申请状态</th>
                    <th style="text-align: center">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat=" con in conflictSource ">
                    <!--<td>{{con.nickname}}</td>
                    <td>{{con.pay_time | limitTo : 10}}</td>
                    <td>{{con.pay_mount}}</td>
                    <td>{{con.username}}</td>
                    <td>{{con.sector_name}}</td>                            
                    <td>{{con.payrecordcreatetimeafter |  limitTo : 10}}</td>
                    <td>{{con.payrecordamount}}</td>
                    <td>{{con.usernameafter}}</td>
                    <td>{{con.sectornameafter}}</td>
                    <td>{{con.createtimeafter |  limitTo : 10}}</td>
                    <td ng-if="con.status == 0">未处理</td>
                    <td ng-if="con.status == 1">申诉成功(100%)</td>
                    <td ng-if="con.status == 2">申诉成功(平均分配)</td>
                    <td ng-if="con.status == 3">申诉失败</td>                             
                    <td ng-if="con.status == 4">客户退款</td>-->
                    
                    <!--20170714 wjw添加客户浮窗开始-->
                    <td><!-- {{con.nickname}} -->
                        <div float_layer customer-id='con.customer_id' show-name="con.nickname"></div>
                    </td>
                    <!--添加浮窗结束-->
                    <td style="text-align: right">{{con.pay_mount}}</td>
                    <td>{{con.username}}</td>
                    <td>{{con.respondent_manager}}</td>
                    <td>{{con.claimant}}</td>
                    <td>{{con.claimant_manager}}</td>
                    <td>{{con.create_time | limitTo : 10}}</td>
                    <td ng-if="con.status == 0">未处理</td>
                    <td ng-if="con.status == 1">成功</td>
                    <td ng-if="con.status == 2">平均</td>
                    <td ng-if="con.status == 3">失败</td>
                    <td ng-if="con.status == 4">退款</td>
                    <td style="text-align: center">
                        <a href="javascript:;" title="撞单审核结果查看" ng-click="conflictEdit()">查看</a>
                        <!--<a href="javascript:;" title="删除查账审核" ng-click="conflicDelte()">删除</a>  -->
                    </td>
                </tr>
            </tbody>
            <tr>
                <td colspan="9" ng-show="conflictpages.pageAll == 0">
                    <p class="null_data">没有找到数据~~~</p>
                </td>

            </tr>
        </table>
        <div class="ui pagination menu fr " ng-show="conflictpages.pageAll > 1" class="ui borderless pagination menu" jspagination page-object="conflictpages" page-func="conflictDatalist"></div>
    </div>
</div>
<!-- list is the end -->

<!-- add form is beginning -->
<div class="ui add modal">
    <i class="close icon"></i>
    <div class="header_h4">
        撞单审核添加
    </div>
    <div class="content">
        <div class="ui form">
            <form name="formConflict" id="conflictId">
                <div class="fields" style="line-height: 32px">
                    <div class="six wide field required">
                        <label class="fl">申诉业务员</label>
                        <div class="fl" >
                            <input type="hidden" name="add_user" id="add_user" />
                            <div angucomplete-alt id="ConMsgUser"
                            placeholder="业务员姓名/电话号码"
                            maxlength="50"
                            name="customer_id"
                            pause="100" 
                            selected-object="selectUser"
                            local-data="UserMsg"
                            search-fields="nickname,phone"
                            title-field="nickname"
                            minlength="1"
                            input-class="form-control form-control-small"
                            input-changed="UserinputChanged"
                            match-class="highlight"
                            style="width: 160px; margin-left: 1em">
                            </div> 
                        </div>
                    </div>
                    <div class="two wide field"></div>
                    <div class="six wide field required">
                        <label class="fl">客户姓名/电话号码</label>
                         <div class="fl" >
                            <input type="hidden" name="add_customer" id="add_customer" />
                            <div angucomplete-alt id="ConMsg"
                            placeholder="客户姓名/电话号码"
                            maxlength="50"
                            name="ConMsg"
                            pause="100" 
                            selected-object="selectCustomer"
                            local-data="CustomerMsg"
                            search-fields="nickname,phone"
                            title-field="nickname"
                            minlength="1"
                            input-class="form-control form-control-small"
                            input-changed="inputChanged"
                            match-class="highlight"
                            style="width: 160px; margin-left: 1em">
                            </div> 
                        </div>
                       <!--  <input type="hidden" name="add_customer" id="add_customer" />
                        <div angucomplete-alt id="ConMsg" class="fl" placeholder="客户姓名/电话号码" maxlength="50" name="ConMsg" pause="100" selected-object="selectCustomer" local-data="CustomerMsg" search-fields="nickname,phone" title-field="nickname" minlength="1" input-class="form-control form-control-small"
                            match-class="highlight" input-changed="inputChanged" focus-first='true' style="width: 160px; margin-left: 1em"></div> -->
                    </div>
                </div>
                <div class="ui attached segment " ng-if="customerInfo">
                    <div class="clearfix">
                        <div class="fl"><b>客户付款记录(勾选)</b></div>
                        <div class="fr"><b>客户当前归属人：</b><span>{{customer_belong}}</span></div>
                    </div>
                    <table class="ui column  celled table pt10" style="text-align: center;padding-top:0px">
                        <thead>
                            <tr>
                                <th></th>
                                <th>客户姓名</th>
                                <th>服务人员姓名</th>
                                <th>服务人员部门</th>
                                <th>付款金额</th>
                                <th>付款时间</th>
                                <th>付款类型</th>
                                <th>是否撞单</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="customer in customerInfo">
                                <td><input type="checkbox" name="u_pay_record" id="{{customer.pay_id}}" value="{{customer.pay_mount}}" ng-model="IsChecked" ng-change="change()" ng-click="validcheckbox()" style="margin-top:4px;margin-right:3px;"></td>
                                <td>{{customer.customer_name}}</td>
                                <td>{{customer.usernickname}}</td>
                                <td>{{customer.sector_name}}</td>
                                <td>{{customer.pay_mount}}</td>
                                <td>{{customer.pay_time | limitTo : 10}}</td>
                                <td>{{customer.pay_way}}</td>
                                <td style="text-align: center">
                                    <span ng-if="customer.is_conflict == 0 || customer.is_conflict == ''">否</span>
                                    <span ng-if="customer.is_conflict == 1">是</span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="field">
                    <div id="extradiv" style="min-height: 20px;"></div>
                </div>
                <!--<div class="ui basic red pointing prompt label transition visible" ng-if="extradiv">请勾选撞单流水记录</div>-->
                <!--<div error-msg info='customerInfo'></div>-->
                <div class="three fields">
                    <div class="field required">
                        <label class="label_fl">申诉状态</label>
                        <select ng-model="dropdownstauts" ng-options="status.k as status.v for status in conflictstatus" name="dropdowndealstatus" class="ui dropdown">
                            <option value="" selected disabled hidden>业绩申诉状态</option>
                        </select>
                    </div>
                    <div ng-show="IsRefund" class="inline field" style="line-height: 32px; margin-left: 3em; margin-right: -2em;">
                        <label>是否修改归属权</label>
                        <div class="ui radio checkbox">
                            <input name="frequency" value="1" type="radio" ng-click="radioEvent(1)">
                            <label>是</label>
                        </div>
                        <div class="ui radio checkbox" style="margin-left: 10px">
                            <input name="frequency" value="0" type="radio" ng-click="radioEvent(0)">
                            <label>否</label>
                        </div>
                    </div>
                    <div ng-show="ifdisplay" class="inline field">
                        <label class="label">客户归属人员</label>
                        <select ng-model="dropdownUser" id="cleardropdown" ng-options="user.user_id as user.nickname for user in getCustomerServicePeople" name="dropdownsalescustomer" class="ui dropdown">
                        <option value="" selected disabled hidden>客户归属人员</option>
                        </select>
                    </div>
                </div>
                <div class="field required">
                    <label for="textfield" class="li_lable">审核结果</label>
                    <textarea placeholder="审核结果" ng-model="textarea" style="margin-bottom:10px" name="textarea_add"></textarea>
                </div>
                <div class="field required">
                    <div class="field required" style="line-height: 32px;">
                        <label for="textfield" class="fl">备注信息</label>
                        <input type="text" placeholder="备注信息" ng-model="note" name="note_add" style="width: 835px;margin-left: 10px;">
                    </div>
                </div>
                <!--<div class="ui divider"></div>-->
            </form>
        </div>
    </div>
    <div class="actions">
        <div class="ui green button positive" id="sure">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>
<!--add form is the end -->


<!-- edit form is beginning -->
<div class="ui edit modal">
    <i class="close icon"></i>
    <div class="header_h4">
        撞单审核查看
    </div>
    <div class="content">
        <div class="ui form">
            <form name="formConflictEdit" id="ConflictIdEdit">
                <div class="two fields" style="line-height: 32px">
                    <div id="test_No" class="field required">
                        <label class="fl">姓名/电话号码：</label>
                        <div angucomplete-alt id="ConMsgUserEdit" class="fl" placeholder="申诉人姓名/电话号码" maxlength="50" name="ConMsgUserEdit" pause="100" selected-object="selectUser" local-data="UserMsg" search-fields="nickname,phone" title-field="nickname" minlength="1" input-class="form-control form-control-small"
                            match-class="highlight" disable-input="disableInput" style="width: 240px; margin-left: 1em;border: none"></div>
                    </div>


                    <div id="test_No" class="field required">
                        <label class="fl">客户姓名/电话号码：</label>
                        <div angucomplete-alt id="ConMsgEdit" class="fl" placeholder="客户姓名/电话号码" maxlength="50" name="ConMsgEdit" pause="100" selected-object="selectCustomer" local-data="CustomerMsg" search-fields="nickname,phone" title-field="nickname" minlength="1" input-class="form-control form-control-small"
                            match-class="highlight" disable-input="disableInput" style="width: 240px; margin-left: 1em;border: none"></div>
                    </div>
                </div>

                <div class="ui attached message" ng-if="customerInfoEdit">
                    <div><b>客户付款记录</b></div>
                    <table class="ui column table">
                        <thead>
                            <tr>
                                <th></th>
                                <th>客户姓名</th>
                                <th>服务人员姓名</th>
                                <th>服务人员部门</th>
                                <th>付款金额</th>
                                <th>付款时间</th>
                                <th>付款类型</th>
                                <th>是否撞单</th>
                            </tr>
                            <tr ng-repeat="customerEdit in customerInfoEdit">
                                <td style="text-align:center;">
                                    <input type="checkbox" name="u_pay_record_edit" id="{{customerEdit.payrecord_id}}" ng-disabled="true" value="{{customerEdit.pay_mount}}" ng-checked="customerEdit.verify" style="margin-top:4px;margin-right:3px;">
                                </td>
                                <td>{{customerEdit.customer_name}}</td>
                                <td>{{customerEdit.usernickname}}</td>
                                <td>{{customerEdit.sector_name}}</td>
                                <td>{{customerEdit.pay_mount}}</td>
                                <td>{{customerEdit.pay_time | limitTo : 10}}</td>
                                <td>{{customerEdit.pay_way}}</td>
                                <td style="text-align:center;">
                                    <span ng-if="customerEdit.is_conflict == 0 || customerEdit.is_conflict == ''">否</span>
                                    <span ng-if="customerEdit.is_conflict == 1">是</span>
                                </td>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div class="ui divider"></div>
                <div class="three fields">
                    <div class="field required" style="line-height: 32px;">
                        <b style="margin-right: 1em; font-size:13px; color: rgba(0,0,0,0.87)">处理状态：</b>
                        <!--<select class="select_text2" name="dropdowndealstatusEdit" ng-model="dropdownstautsEdit" id="dropdownsEdit" ng-options ="status.k as status.v for status in conflictstatus" ng-disabled="true" style=" border-radius:3px; padding-left: 0.9em; margin-left: 0.3em; float:left; height: 32px;">
                            <option value=""  selected disabled hidden>处理状态</option>
                        </select> -->
                        <span ng-if="dropdownstautsEdit==1">成功</span>
                        <span ng-if="dropdownstautsEdit==2">平分</span>
                        <span ng-if="dropdownstautsEdit==3">失败</span>
                        <span ng-if="dropdownstautsEdit==4">退款</span>
                    </div>

                    <div class="inline field" style="line-height: 32px">
                        <!--<label>是否放弃归属权</label>  -->
                        <label>是否修改归属权：</label>
                        <div class="ui radio checkbox" ng-show="express_A_show">
                            <input name="frequency" ng-model="express_A" value="1" type="radio" ng-click="radioEvent(1)" ng-disabled="true">
                            <label>是</label>
                        </div>
                        <div class="ui radio checkbox" ng-show="express_B_show">
                            <input name="frequency" ng-model="express_A " value="0" type="radio" ng-click="radioEvent(0)" ng-disabled="true">
                            <label>否</label>
                        </div>
                    </div>
                    <div ng-show="editdisplay" class="inline field" style="line-height: 32px;">
                        <div class="inline field">
                            <b style="font-size:13px; color: rgba(0,0,0,0.87)" ng-show="labelshow">客户归属人员：</b>
                            <span> {{dropdownUserEdit}}</span>
                            <!--<select class="select_text2"  ng-disabled = "true" style=" border-radius:3px;width:170px; padding-left: 0.9em; margin-left: 0.3em; float:left; height: 32px;">
                                <option value="{{dropdownUserEdit}}" selected disabled >{{dropdownUserEdit}}</option>
                            </select>  -->
                        </div>
                    </div>
                </div>

                <div class="field required" style="margin-top: 1em;">
                    <label for="textfield" class="li_lable" style="font-weight: 700;" ng-disabled="true">审核结果</label>
                </div>
                <div class="field required">
                    <!--<textarea placeholder="审核结果" ng-model = "textareaEdit"  name="textarea_Edit"  ng-disabled="true"   style="margin-bottom:10px;border: none;min-height: 50px"></textarea>-->
                    <!--<div ng-bind = "textareaEdit"></div>-->
                    <p ng-bind="textareaEdit" name="textarea_Edit" ng-disabled="true" style="color: #999; padding-left: 0.5em"></p>
                </div>
                <div class="field required" style="margin-bottom:0px;">
                    <label for="textfield" class="li_lable">备注信息</label>
                </div>
                <div class="field required">
                    <input type="text" ng-model="noteEdit" name="note_Edit" style="margin-top:10px;border: none" ng-disabled="true">
                </div>

                <div class="ui divider"></div>
                <div class="actions" style="padding-top: 8px;padding-bottom: 8px; text-align: center;">
                    <button class="ui grey button negative">取消</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--edit form is the end -->

<!-- delete form is beginnig -->
<!--<div class="ui modal modal3" id="conflict_del">
    <div class="header" style="text-align: center;">删除撞单</div>
    <div class="content" style="text-align: center;">
        <i class="huge blue help circle icon"></i>
        <p style="padding-top: 15px;">确认删除该撞单及相关处理人员的信息吗?</p>
    </div>
    <div class="actions" style="text-align: center;">
        <div class="ui positive button">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>-->
<!-- delete form is the end -->

<!--add success-->
<div class="ui modal modal1" style="text-align: center;">
    <div class="header center aligned">提示</div>
    <div class="content center aligned">
        <i class="huge green check circle outline icon"></i>
        <p style="padding-top: 15px;">添加成功</p>
    </div>
</div>
<!--add success-->
<div class="ui modal modal2" style="text-align: center;">
    <div class="header center aligned">提示</div>
    <div class="content center aligned">
        <i class="huge red remove circle outline icon"></i>
        <p style="padding-top: 15px;">添加失败</p>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $('.ui.dropdown').dropdown();
        $('#conflictId').form({
            on: 'blur',
            inline: true,
            fields: {
                add_customer: {
                    identifier: 'add_customer',
                    rules: [{
                        type: 'empty',
                        prompt: '客户不存在'
                    }]
                },
                add_user: {
                    identifier: 'add_user',
                    rules: [{
                        type: 'empty',
                        prompt: '申诉人不存在'
                    }]
                },
                note_add: {
                    identifier: 'note_add',
                    rules: [{
                        type: 'empty',
                        prompt: '备注信息不能为空'
                    }, {
                        type: 'maxLength[500]',
                        prompt: '备注信息不能超过500个'
                    }]
                },
                textarea_add: {
                    identifier: 'textarea_add',
                    rules: [{
                        type: 'empty',
                        prompt: '审核结果不能为空'
                    }, {
                        type: 'maxLength[100]',
                        prompt: '审核结果不能超过100个'
                    }]
                },
                dropdowndealstatus: {
                    identifier: 'dropdowndealstatus',
                    rules: [{
                        type: 'empty',
                        prompt: '处理状态不能为空'
                    }]
                },
                tobe: {
                    identifier: 'tobe',
                    rules: [{
                        type: 'empty',
                        prompt: '处理状态不能为空'
                    }]
                }
            }
        });

        //延时登记所有需要blur验证的hidden input（可视的input开始时未生成）
        setTimeout(function() {
            registerHiddenBlur('add_customer', 'ConMsg_value');
            registerHiddenBlur('add_user', 'ConMsgUser_value');
        }, 200);

        setTimeout(function() {
            registerHiddenBlur_test('tobe');
        }, 200);


    });

    //登记所有需要blur验证的hidden input，振东和张叶商量放在公共js中供大家调用
    //hiddenID: hidden input的id
    //visibleID: hidden input对应的可视input id，通常由输入组件运行时动态创建。如ConMsg动态生成ConMsg_value
    function registerHiddenBlur(hiddenID, visibleID) {
        $('#' + visibleID).blur(function() {
            //延时触发blur，目的是让hidden input先于blur被赋值
            setTimeout(function() {
                $('#' + hiddenID).trigger('blur');
            }, 100);
        });
    }

    function registerHiddenBlur_test(hiddenID) {
        //延时触发blur，目的是让hidden input先于blur被赋值
        // setTimeout(function() {
        // $('#' + visibleID).addClass('error');
        $('#' + hiddenID).trigger('blur');
        // }, 100);
    }
</script>